package com.ruidan.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.struts.action.Action;
import org.struts.annotation.Controller;
import org.struts.form.ActionForm;
import com.ruidan.form.LoginForm;

@Controller("login")
public class LoginAction implements Action{

	public String execute(ActionForm form, HttpServletRequest request,
			HttpServletResponse response) {
		LoginForm loginForm =(LoginForm) form;
		if(loginForm.getUsername().equals("ylz")&&loginForm.getPassword().equals("1234")){
			request.setAttribute("msg",loginForm.toString());
			return "/view/ok.jsp";
		}else{
            request.setAttribute("msg", "message error!!!!");			
			return "/view/error.jsp";
		}
		
	}

}
